<?php
/**
 * Services_Omniture
 *
 * PHP Version 5.1.0+
 *
 * @package   Services_Omniture
 * @copyright 2008 Digg, Inc.
 * @author    Bill Shupp <bill@digg.com> 
 * @license   Digg Internal
 */

require_once 'Services/Omniture/Common.php';
require_once 'Services/Omniture/Exception.php';

/**
 * Services_Omniture 
 * 
 * @package   Services_Omniture
 * @copyright 2008 Digg, Inc.
 * @author    Bill Shupp <bill@digg.com> 
 * @license   Digg Internal
 */
abstract class Services_Omniture
{
    /**
     * Factory
     *
     * @param string $api       Api driver
     * @param array  $options   Options
     * @param string $requestor Method of sending http requests
     *
     * @return Services_Omniture_Common
     */
    public static function factory($api,
                                   array $options,
                                   $requestor = 'HTTPRequest')
    {
        $file  = 'Services/Omniture/' . $api . '.php';
        $class = 'Services_Omniture_' . $api;
        include_once $file;
        if (!class_exists($class)) {
            throw new Services_Omniture_Exception('Invalid Omniture API requested');
        }
        return new $class($options, $requestor);
    }
}
?>
